package com.leetcode.LC;

public class LC1716 {
    public int totalMoney(int n) {//28
        int a = n / 7, b = n % 7;
        int sum = 0, tmp = 28;
        for (int i = 0; i < a; i++) {
            sum += tmp;
            tmp += 7;
        }
        for (int i = 0; i < b; i++) {
            a += 1;
            sum += a;
        }
        return sum;
    }

    public static void main(String[] args) {
        System.out.println(new LC1716().totalMoney(10));
    }

}
